package com.py.korona.db.model;

import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import com.py.korona.db.UriBuilder;
import com.py.korona.db.model.base.Entity;
import com.py.korona.db.model.base.EntityDescription;
import com.py.korona.db.model.base.EntityProperty;

public class RoomInGeoplan extends Entity {
    public static String             FieldNameGeoplan = "geoplan";
    public static String             FieldNameID      = "_id";
    public static String             FieldNameRoom    = "room";
    public static String             Table            = "roomingeoplan";
    private static EntityDescription entityDescription_;
    private long                     geoplan;
    private long                     room;

    public static String entityTableName() {
        return RoomInGeoplan.Table;
    }

    public static EntityDescription entityDescription() {
        if (null == entityDescription_) {
            entityDescription_ = new EntityDescription();
            entityDescription_.addProperty(new EntityProperty(RoomInGeoplan.FieldNameID, "integer", null, "primary key autoincrement"));
            entityDescription_.addProperty(new EntityProperty(RoomInGeoplan.FieldNameRoom, "integer", null, "not null"));
            entityDescription_.addProperty(new EntityProperty(RoomInGeoplan.FieldNameGeoplan, "integer", null, "not null"));
        }
        return entityDescription_;
    }

    public static String uriAuthority() {
        return "RoomInGeoPlanContentProvider";
    }

    public static String uriBasePath() {
        return "roomingeoplan";
    }

    public long getGeoplan() {
        return geoplan;
    }

    public void setGeoplan(long geoplan) {
        this.geoplan = geoplan;
    }

    public long getRoom() {
        return room;
    }

    public void setRoom(long room) {
        this.room = room;
    }

    @Override
    protected ContentValues contentValues() {
        ContentValues contentValues = new ContentValues();
        contentValues.put(RoomInGeoplan.FieldNameRoom, this.getRoom());
        contentValues.put(RoomInGeoplan.FieldNameGeoplan, this.getGeoplan());
        return contentValues;
    }

    @Override
    protected Uri objectsListUri() {
        return UriBuilder.objectListUri(RoomInGeoplan.uriAuthority(), RoomInGeoplan.uriBasePath());
    }

    @Override
    protected void onDataChanged(Cursor cursor) {
        // TODO Auto-generated method stub
    }
}
